package cn.lingyangwl.agile.misc.order.model;

import cn.lingyangwl.agile.model.constants.*;
import cn.lingyangwl.framework.validation.group.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单
 *
 * @author shenguangyang
 */
@Getter
@Setter
public class OrderBase {
    @NotNull(message = ValidationCons.NOT_EMPTY, groups = UpdateGroup.class)
    private Long id;

    @NotEmpty(message = ValidationCons.NOT_EMPTY)
    @ApiModelProperty(value = "订单编号")
    private String orderNo;

    @NotEmpty(message = ValidationCons.NOT_EMPTY)
    @ApiModelProperty(value = "订单来源")
    private String orderFrom;

    @ApiModelProperty(value = "提货编码(eg: 取餐号)")
    private String deliveryCode;

    @ApiModelProperty(value = "桌号id")
    private Long tableId;

    @ApiModelProperty(value = "桌号")
    private String tableNo;

    @NotNull(message = ValidationCons.NOT_EMPTY)
    @ApiModelProperty(value = "会员id")
    private Long userId;

    @ApiModelProperty(value = "收货人手机号")
    private String receiverPhone;

    @ApiModelProperty(value = "收货人省id")
    private Long receiverProvinceId;

    @ApiModelProperty(value = "收货人市id")
    private Long receiverCityId;

    @ApiModelProperty(value = "收货人区县id")
    private Long receiverDistrictId;

    @ApiModelProperty(value = "收货人详细地址")
    private String receiverAddress;

    @ApiModelProperty(value = "收货人地址经度")
    private String receiverLongitude;

    @ApiModelProperty(value = "收货人地址纬度")
    private String receiverLatitude;

    @ApiModelProperty(value = "购买人ip地址")
    private String buyerIp;

    @ApiModelProperty(value = "购买人要求配送时间")
    private LocalDateTime buyerAskDeliveryTime;

    @ApiModelProperty(value = "购买人备注")
    private String buyerRemark;

    @ApiModelProperty(value = "支付类型")
    private String payType;

    @ApiModelProperty(value = "配送方式 (10外卖配送 20上门取30打包带走40店内就餐")
    private String deliveryWay;

    @NotNull(message = ValidationCons.NOT_EMPTY)
    @ApiModelProperty(value = "商品总价格")
    private BigDecimal totalPrice;

    @NotNull(message = ValidationCons.NOT_EMPTY)
    @ApiModelProperty(value = "配送价钱")
    private BigDecimal deliveryPrice;

    @NotNull(message = ValidationCons.NOT_EMPTY)
    @ApiModelProperty(value = "订单优惠金额（满减）")
    private BigDecimal promotionPrice;

    @NotNull(message = ValidationCons.NOT_EMPTY)
    @ApiModelProperty(value = "优惠券id")
    private Long couponId;

    @NotNull(message = ValidationCons.NOT_EMPTY)
    @ApiModelProperty(value = "优惠卷金额")
    private BigDecimal couponPrice;

    @NotNull(message = ValidationCons.NOT_EMPTY)
    @ApiModelProperty(value = "订单总金额")
    private BigDecimal orderPrice;

    @NotNull(message = ValidationCons.NOT_EMPTY)
    @ApiModelProperty(value = "抵扣之后应付金额")
    private BigDecimal payPrice;

    @ApiModelProperty(value = "卖家留言")
    private String remark;

    @NotNull(message = ValidationCons.NOT_EMPTY)
    @ApiModelProperty(value = "商品数量")
    private Integer goodsNum;

    @ApiModelProperty(value = "预计发货时间")
    private LocalDateTime predictDeliveryTime;
}
